package com.servlets.project;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.core.GlobalConstants;
import com.core.protocols.IServiceLayerDelegate;
import com.servicelayer.project.ProjectListLayer;
import com.servlets.TaskTrackerServlet;

/**
 * Servlet implementation class ProjectDelete
 */

public class ProjectDelete
        extends TaskTrackerServlet
        implements IServiceLayerDelegate {

    private static final long serialVersionUID = 1L;



    @Override
    public <T> void responseResponseItemsList ( final List <T> items,
                                                final Object request,
                                                final Exception exception ) {

    }



    @Override
    protected void doPost ( HttpServletRequest request,
                            HttpServletResponse response )
            throws ServletException, IOException {

        String projectId = request.getParameter(GlobalConstants.SERVLET_PARAM_KEY);

        ProjectListLayer projectListLayer = new ProjectListLayer();
        projectListLayer.setLayerDelegate(this);
        projectListLayer.deleteObject(projectId);

    }



}
